//統一封裝用aiax發起請求的函數
import ajax from './ajax' 
import mockAjax from './mockAjax'

export const reqCategoryListData= ()=>ajax.get('/product/getBaseCategoryList')
// 发送请求 获取mock数据
export const reqBannerListData = () => mockAjax.get('/banner')
//发送请求 获取floor数据
export const reqGetFloorsListData = ()=>mockAjax.get('/floor')
// 发送请求 获取seatch搜索商品
export const reqGetSearchGoodsInfoData =(searchParams)=>ajax.post('/list',searchParams)
// 发送请求 获取detail详情数据
export const reqGetGoodDetailInfoData = id =>ajax.get(`/item/${id}`)
// 添加购物车的请求    添加选择的商品到服务器端
export const reqAddOrUpdateCart = (skuId, skuNum) => ajax.post(`/cart/addToCart/${skuId}/${skuNum}`)
// 获取购物车中的数据
export const reqGetShopCartListData = ()=>ajax.get('/cart/cartList')

